package com.hf.entity;

import java.io.Serializable;
import java.util.List;

import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author eight
 * @since 2021-06-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Modules对象", description = "")
public class Modules implements Serializable {

	private static final long serialVersionUID = 1L;
	@NotNull
	@JsonProperty("title")
	@ApiModelProperty(value = "模块（权限）名称")
	private String moduleName;

	@ApiModelProperty(value = "父模块id")
	private Integer parentId;

	@ApiModelProperty(value = "模块路径")
	private String path;

	@ApiModelProperty(value = "权重")
	private Double weight;
	@TableId(type = IdType.AUTO)
	private Integer id;
	@TableField(exist = false) // 此注解表示数据库中不存在的字段
	private boolean checked; // 是否被选中

	@TableField(exist = false)
	private List<Modules> children; // 子节点们
}
